package echat.future.cn.echat.my.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import echat.future.cn.echat.R;
import echat.future.cn.echat.my.bean.RemindUserBean;
import echat.future.cn.echat.my.utils.ImageLoadUtils;

public class RemindUserAdapter extends BaseQuickAdapter<RemindUserBean,BaseViewHolder> {
    public RemindUserAdapter(@Nullable List<RemindUserBean> data) {
        super(R.layout.item_remind_user,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RemindUserBean item) {
        ImageLoadUtils.loadImage(mContext,item.getAvatar(),helper.getView(R.id.head));
        helper.setText(R.id.name,item.getUsername()==null?"":item.getUsername())
                .setText(R.id.contribution,item.getCon_num()+"")
        .setText(R.id.time,new SimpleDateFormat("yyyy.yy.mm注册").format(new Date(item.getCreate_time()*1000)))
        .setText(R.id.level,"LV."+item.getLevel());

    }
}
